<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>研究生</el-breadcrumb-item>
      <el-breadcrumb-item>个人信息</el-breadcrumb-item>
    </el-breadcrumb>

    <el-card class="box-card">
      <el-descriptions title="个人信息">
        <el-descriptions-item label="姓名" v-if="selfInfo[0]">{{
          selfInfo[0].user.username
        }}</el-descriptions-item>
        <el-descriptions-item label="性别" v-if="selfInfo[0]">{{
          selfInfo[0].user.sex === 0 ? "女" : "男"
        }}</el-descriptions-item>
        <el-descriptions-item label="电话号码" v-if="selfInfo[0]">{{
          selfInfo[0].user.mobile
        }}</el-descriptions-item>
        <el-descriptions-item label="学历" v-if="selfInfo[0]">{{
          selfInfo[0].role.desc
        }}</el-descriptions-item>
        <el-descriptions-item label="学校" v-if="selfInfo[0]">{{
          selfInfo[0].identity.school
        }}</el-descriptions-item>
        <el-descriptions-item label="专业" v-if="selfInfo[0]">{{
          selfInfo[0].identity.profession
        }}</el-descriptions-item>
        <el-descriptions-item label="入学年份" v-if="selfInfo[0]">{{
          selfInfo[0].identity.entranceYear
        }}</el-descriptions-item>
      </el-descriptions>
    </el-card>
  </div>
</template>

<script>
import axios from "axios";
import { ReqUserInfoByUserId } from "../../request/index.js";
export default {
  data() {
    return {
      selfInfo: [],
    };
  },
  created() {
    ReqUserInfoByUserId({
      id: "13f897e1fc7849a984de24eba92bf4ff",
    }).then((res) => {
      this.selfInfo.push(res.data);
    });
  },
};
</script>

<style scoped></style>
